import { Map,List } from "immutable";

// const defaultState=Map({
//     cart:List([])
// })
const defaultState={
    cart:[]
}

export default (state=defaultState,action)=>{
    switch(action.type){
        case 'GETCART':
            // return state.updateIn(['cart'],()=>action.payload)
            return {cart:[
                ...state.cart,
                action.payload
            ]}
        default:
            return state
    }
}